Skip to content

Conversation

@rasteiner
Copy link
Contributor

In the clipboard manager plugin, this is the writeHtml command:

pub(crate) async fn write_html<R: Runtime>(
_app: AppHandle<R>,
clipboard: State<'_, Clipboard<R>>,
html: &str,
alt_text: Option<&str>,
) -> Result<()> {
clipboard.write_html(html, alt_text)
}

The fallback plaintext argument is called alt_text.

On the client side however the command is invoked like this:

async function writeHtml(html: string, altHtml?: string): Promise<void> {
await invoke('plugin:clipboard-manager|write_html', {
html,
altHtml
})
}

the alternative text is passed as altHtml. This causes the alt_text argument to be always empty, resulting in an empty string to be copied into the clipboard.

This PR...

renames the argument on the client-side to match that of the backend.

@rasteiner rasteiner requested a review from a team as a code owner November 26, 2024 09:51
@rasteiner rasteiner changed the title fix clipboard: alt_text in write_html command not being passed with correct argument name fix(clipboard): alt_text in write_html command not being passed with correct argument name Nov 26, 2024
@github-actions
Copy link
Contributor

github-actions bot commented Nov 26, 2024

Package Changes Through e70466b

There are 18 changes which include fs with minor, upload with minor, upload-js with minor, updater with minor, clipboard-manager-js with patch, deep-link with patch, deep-link-js with patch, persisted-scope with minor, log-plugin with patch, log-js with patch, fs-js with patch, http with patch, localhost with minor, opener with major, opener-js with major, positioner-js with minor, positioner with minor, sql with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
api-example 2.0.5 2.0.6
api-example-js 2.0.2 2.0.3
deep-link-example-js 2.0.0 2.0.1
clipboard-manager-js 2.0.0 2.0.1
deep-link 2.0.1 2.0.2
deep-link-js 2.0.0 2.0.1
fs 2.0.3 2.1.0
fs-js 2.0.2 2.0.3
dialog 2.0.3 2.0.4
opener 1.0.0 2.0.0
opener-js 1.0.0 2.0.0
http 2.0.3 2.0.4
localhost 2.0.1 2.1.0
log-plugin 2.0.2 2.0.3
log-js 2.0.0 2.0.1
persisted-scope 2.0.3 2.1.0
positioner 2.0.2 2.1.0
positioner-js 2.0.1 2.1.0
single-instance 2.0.1 2.0.2
sql 2.0.2 2.0.3
updater 2.0.2 2.1.0
upload 2.1.0 2.2.0
upload-js 2.1.0 2.2.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like you need to run pnpm build and can you also add a change file in .changes directory?

@rasteiner
Copy link
Contributor Author

Sorry, it's my first time contributing here.
Is it ok like this?

@amrbashir
Copy link
Member

Thank you

@amrbashir amrbashir merged commit 3fa0fc0 into tauri-apps:v2 Nov 26, 2024
10 checks passed
@rasteiner rasteiner deleted the fix/clipboard-alt-text branch November 26, 2024 12:47
gezihuzi pushed a commit to Hypobenthos/plugins-workspace that referenced this pull request Jun 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants